package me.snowiest.snowdrift.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Map;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Tag implements Serializable {
    private Integer id;
    private String name;
    private String description;

    public Tag(
            Object id,
            Object name,
            Object description
    ) {
        this.id = (Integer) id;
        this.name = (String) name;
        this.description = (String) description;
    }

    public Tag(Map<String, Object> tagMap) {
        this(
                tagMap.get("id"),
                tagMap.get("name"),
                tagMap.get("description")
        );
    }
}
